//
//  caAppDelegate.m
//  Cloud Aggregator
//
//  Created by Justin Rohrer on 4/25/12.
//  Copyright (c) 2012 RTS. All rights reserved.
//

#import "caAppDelegate.h"

@implementation caAppDelegate

@synthesize window = _window;

- (void)dealloc
{
    [super dealloc];
}
	
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
}


//-----------------
//NSOpenPanel: Displaying a File Open Dialog in OS X 10.7
//-----------------

// Any ole method
- (NSURL*)findFolder
{
    
    // Loop counter.
    //int i;
    
    // Create a File Open Dialog class.
    NSOpenPanel* openDlg = [NSOpenPanel openPanel];
    
    // Set array of file types
    //NSArray *fileTypesArray;
    //fileTypesArray = [NSArray arrayWithObjects:@"jpg", @"gif", @"png", nil];
    
    // Enable options in the dialog.
    [openDlg setCanChooseFiles:NO];
    //[openDlg setAllowedFileTypes:fileTypesArray];
    [openDlg setAllowsMultipleSelection:FALSE];
    
    NSURL *folder;
    
    // Display the dialog box.  If the OK pressed,
    // process the files.
    if ( [openDlg runModal] == NSOKButton ) {
        
        // Gets list of all files selected
        folder = [openDlg URL];
        
        // Loop through the files and process them.
        //for( i = 0; i < [files count]; i++ ) {
            
            // Do something with the filename.
            //NSLog(@"File path: %@", [[files objectAtIndex:i] path]);
            
        //}
        
    }

    return folder;
}

@end
